<template>
  <div class="container">
    <van-nav-bar
      class="nav_bar"
      :class="$route.path==='/home'?'btn':''"
      :left-arrow="$route.path==='/login'"
      @click-left=$router.back()
    >
      <span slot="title" v-if="$route.path==='/login'">{{title}}</span>
      <van-button class="van_btn" round slot="title" v-if="$route.path==='/home'">{{title}}</van-button>
    </van-nav-bar>
    <!-- <h1>{{title}}</h1> -->
  </div>
</template>

<script>
export default {
  name: "Header",
  mounted() {},
  created() {},
  data() {
    return {};
  },
  props: {
    title: {
      type: String,
    }
  },
  methods: {},
};
</script>

<style lang="less" scoped>
 /deep/.nav_bar {
  background-color: #3296fa;
 .van-nav-bar__title{
        color: snow;
    }
    .van-nav-bar__arrow{
        color: snow;
    }

}
/deep/.btn{
  .van-nav-bar__title{
    max-width: unset;
  }
.van_btn{
        width: 277px;
        height: 32px;
        background: #5babfb;
         color: snow;
         border: unset;
         .van-button__text{
           font-size: 13px;
         }
    }
}
</style>
